<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>登陆</title>
        {load href="__COMMON__/js/jquery.min.js,__COMMON__/css/bootstrap.min.css,__STATIC__/login/css/style.css,https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"}
</head>
<body>
	<div class="sucaihuo-container">
		<div class="demo form-bg" style="padding: 20px 0;">
		        <div class="container">
		            <div class="row" style="margin-top: 105px">
		                <div class="col-md-offset-3 col-md-6">
		                    <form class="form-horizontal">
		                        <span class="heading">用户登录(注册)</span>
		                        <div class="form-group">
                                            <input type="text" class="form-control" id="name" placeholder="用户名" name="user_name">
		                            <i class="fa fa-user"></i>
		                        </div>
		                        <div class="form-group help">
                                            <input type="password" class="form-control" id="pwd" placeholder="密　码" name="passwd">
		                            <i class="fa fa-lock"></i>
		                        </div>
		                        <div class="form-group">
		                            <div class="main-checkbox">
		                                <input type="checkbox" value="None" id="checkbox1" name="check"/>
		                                <label for="checkbox1"></label>
		                            </div>
		                            <span class="text">记住我</span>
                                            <button type="button" class="btn btn-default" id="sub">登录(注册)</button>
		                        </div>
		                    </form>
		                </div>
		            </div>
		        </div>
		    </div>
	</div>
</body>
<script>
    $(function(){
        $('#sub').click(function(){
            var name = $.trim($('#name').val());
            var pwd = $.trim($('#pwd').val());
            if(name == '' || pwd == ''){
                return false;
            }else{
                $.getJSON('index.php/index/login/login',{name:name,pwd:pwd},function(e){
                    if(e.status == 1){
                        window.location.href = e.url;
                    }else{
                        alert(e.msg);
                    }
                });
            }
        })
    })
</script>
</html>